import { ArbitratorSchema } from '@src/components/schema/arbitrator'
import { ColumnsType } from 'antd/es/table'
import { Space, Divider } from 'antd'

export function getColumn (setVisible: (v: boolean) => void, setModifyData: (v: ArbitratorSchema) => void, refreshData: () => void): ColumnsType<ArbitratorSchema> {
  const columns: ColumnsType<ArbitratorSchema> = [
    {
      title: '序号',
      dataIndex: 'orderno',
      key: 'orderno',
      width: 75
    },
    {
      title: '姓名',
      dataIndex: 'name',
      key: 'name'
    },
    {
      title: '职业分类',
      dataIndex: 'occupation',
      key: 'occupation'
    },
    {
      title: '所在区域',
      dataIndex: 'area',
      key: 'area'
    },
    {
      title: '专业',
      dataIndex: 'professional',
      key: 'professional'
    },
    {
      title: '职务',
      dataIndex: 'structure_post',
      key: 'structure_post'
    },
    {
      title: '操作',
      dataIndex: 'id',
      key: 'id',
      render: (v: string, l: ArbitratorSchema) => {
        return (
          <Space split={<Divider type='vertical' />}>
            <a onClick={() => { setModifyData(l); setVisible(true) }}>详情</a>
          </Space>
        )
      }
    }
  ]
  return columns
}
